import java.util.*;

public class Male extends Person {
	private int numberFatherhoods;

	public Male(String name, String surname, int age, String phone,
			int numberFatherhoods) {
		super(name, surname, age, phone);
		this.numberFatherhoods = numberFatherhoods;
	}

	public void setNumberFatherhoods() {
		Scanner sc = new Scanner(System.in);
		numberFatherhoods = sc.nextInt();
		sc.close();
	}

	public int getNumberFatherhoods() {
		return numberFatherhoods;
	}

	/*public void addMale() {
		addPerson();
		setNumberFatherhoods();
	}*/

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (this == obj) {
			return true;
		}
		if (this.getClass() == obj.getClass()) {
			Male male = (Male) obj;
			if (male.numberFatherhoods == numberFatherhoods) {
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		int hash = 1;
		hash = hash * 17 + numberFatherhoods;
		hash = 17*hash + super.name.hashCode()+ super.surname.hashCode()+ super.phone.hashCode() ;
		return hash;
	}

	public boolean matchByName(String name, Person p) {
		if (name.equals(p.name)) {
			return true;
		}
		return false;
	}

	public boolean matchBySurname(String surname, Person p) {
		if (surname.equals(p.surname)) {
			return true;
		}
		return false;
	}

	public boolean matchByAge(int age, Person p) {
		if (age == p.age) {
			return true;
		}
		return false;
	}

	public boolean matchByPhone(String phone, Person p) {
		if (phone.equals(p.phone)) {
			return true;
		}
		return false;
	}

}
